const {userMod}=require('../mod/userMode.js');

module.exports.userLogin=async function(Info){
  let data = await userMod.find({account:Info.account,passwrod:Info.password});
  return data[0];
}

module.exports.userImg=async function(Info){
  let data = await userMod.find({_id:Info.id})
  return data[0];
}

module.exports.updateImg=async function(Info){
  let data = await userMod.findOneAndUpdate({_id:Info._id},{img:Info.img});
}

module.exports.newRegis=async function(Info){
  let data = await userMod.create(Info);
  return data;
}

module.exports.userInfo=async function(Info){
  let data = await userMod.find({_id: Info.id})
  return data[0];
}

module.exports.userAllInfo=async function(){
  let data = await userMod.find();
  return data;
}